export function format (v) {
  const reg = /\d{1,3}(?=(\d{3})+$)/g
  return `${v}`.replace(reg, '$&,')
}

export function money (v) {
  const reg = /\d{1,3}(?=(\d{3})+$)/g
  return '￥ ' + `${v}`.replace(reg, '$&,')
}

export function pct (v) {
  const value = Math.floor(v * 1000000) / 10000
  return value + '%'
}
